package com.karina.visualization.styles;

import java.util.HashMap;
import java.util.Map;

public class StylesManager {

	private final Map<String, CSSDeclaretions> maps = new HashMap<String, CSSDeclaretions>();

	private static StylesManager manager;

	/**
	 * get instance of StyleManager
	 * 
	 * @return
	 */
	public static StylesManager getIntance() {
		if (manager == null) {
			manager = new StylesManager();
		}
		return manager;
	}

	public void setStyle(String selector, String style, Object value) {
		getStyle(selector).setStyle(style, value);
	}

	public CSSDeclaretions getStyle(String selector) {
		CSSDeclaretions css = maps.get(selector);
		if (css == null) {
			css = new CSSDeclaretions(selector);
			maps.put(selector, css);
		}
		return css;
	}

}
